<template>
  <div class="warpc">
    <div
      class="content"
      v-for="(v, i) in shopById"
      :key="10 + i"
      @click="fun1(i)"
    >
      <div class="left">
        <img :src="v.storeImg" alt="" />
      </div>
      <div class="right">
        <p class="title">{{ v.storeName }}</p>
        <p class="mass">
          <img class="start" src="chenkong/imgs/shopcenter/start.gif" alt="" />
          <img class="start" src="chenkong/imgs/shopcenter/start.gif" alt="" />
          <img class="start" src="chenkong/imgs/shopcenter/start.gif" alt="" />
          <img class="start" src="chenkong/imgs/shopcenter/start.gif" alt="" />
          <img class="start" src="chenkong/imgs/shopcenter/start.gif" alt="" />
          <span class="orgren">4.5</span> <span>246</span>条 ￥<span>{{
            v.storePrice
          }}</span
          >/人
        </p>
        <p>
          <span>湘菜</span> <span>{{ v.storeIp }}</span>
        </p>
        <p class="pjad">
          <img class="pj" src="chenkong/imgs/shopcenter/pj.gif" alt="" /><span
            class="adress"
            >“高新软件园美食好评榜第7名”</span
          >
        </p>
        <p>{{ v.storeArea }}</p>
        <p class="last-line">
          <span class="orgren tuan">团</span> <span class="orgren">￥</span
          ><span class="orgren">{{ v.storePrice }}</span>
          <span>双人豪华餐，提供wifi</span>
        </p>
      </div>
    </div>
  </div>
</template>

<script>
import { findstoreByidCK } from "../../../../api/chenkong.js";
import axios from "axios";
// import qs from "qs";

export default {
  data() {
    return {
      arrshop: [],
      shopById: [],
    };
  },
  created() {
    axios.request("http://localhost:8889/shoplistCK").then(({ data }) => {
      this.arrshop = data;
    });

    findstoreByidCK({ tpid: 1 }).then((ok) => {
      this.shopById = ok.data.data;
    });
  },
  methods: {
    fun(val) {
      this.$router.push({ name: "DetailsPage", query: { i: val } });
    },
    fun1(val) {
      console.log("hehie");
      this.$router.push({ name: "DetailsPage", query: { i1: val } });
      console.log(val);
    },
  },
};
</script>

<style lang="scss" scoped>
.warpc {
  text-align: center;
  .content {
    width: 95%;
    margin: auto;
    display: flex;
    font-size: 2.667vw;
    padding-bottom: 2.667vw;
    .left {
      img {
        width: 21.333vw;
      }
    }
    .right {
      width: 100%;
      margin-left: 3.667vw;
      text-align: left;
      line-height: 6.4vw;
      border-bottom: 0.267vw solid #f4f4f4;
      .title {
        font-weight: bold;
      }
      .mass {
        .start {
          width: 2.667vw;
        }
      }
      .pjad {
        display: flex;
        .pj {
          width: 13.333vw;
        }
        .adress {
          height: 4.2vw;
          background: #fcede2;
          color: #a48470;
          padding: 0 1.333vw 0 1.333vw;
          line-height: 4.133vw;
        }
      }
      .last-line {
        display: flex;
        padding-bottom: 1.333vw;

        .tuan {
          background: #fffef8;
          padding: 0 1.333vw;
          height: 4.533vw;
          vertical-align: middle;
        }
      }
      .orgren {
        color: #dc8261;
        font-weight: bold;
        padding-right: 0.8vw;
      }
    }
  }
}
</style>